<?php
class driver_mysql {
    private $link = null;

    function __construct($host, $username, $pw) {
        $this->link = mysql_connect($host, $username, $pw);
    }

    function selectDatabase($dbName) {
        mysql_select_db($dbName, $this->link);
        mysql_query('set names utf8');
    }

    function getLink() { return $this->link; }

    function escape($str) {
        return mysql_real_escape_string($str);
    }

    function query($queryString) {
        Log::debug("->DB: " . $queryString);
        return mysql_query($queryString, $this->link);
    }
    
    function getInsertedId() {
        return mysql_insert_id($this->link);
    }
}

?>
